home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / SUPERLNK.CMD < prev    next >
Encoding:
Text File  |  1996-02-29  |  2.1 KB  |  223 lines

  1. #    Login.cmd for Superlink (SuperNet)
  2.  
  3. #trace on
  4.  
  5. #
  6.  
  7. # set up some strings for dialling up
  8.  
  9. #
  10.  
  11. if ![load $number]
  12.  
  13.   if [query $number "Enter your dial up phone number"]
  14.  
  15.     save $number
  16.  
  17.   end
  18.  
  19. end
  20.  
  21. if ![load $username]
  22.  
  23.   if [username "Enter your login username"]
  24.  
  25.     save $username
  26.  
  27.   end
  28.  
  29. end
  30.  
  31. if ![load $password]
  32.  
  33.   if [password "Enter your login password"]
  34.  
  35.     save $password
  36.  
  37.   end
  38.  
  39. end
  40.  
  41. $modemsetup = "&c1&k3"
  42.  
  43. $prompt = "ber>"
  44.  
  45. $userprompt = "name:"
  46.  
  47. $passprompt = "word:"
  48.  
  49. $slipcmd = "5"
  50.  
  51. $addrtarg = "Your address is"
  52.  
  53. $pppcmd = "4"
  54.  
  55.  
  56.  
  57. %attempts = 10
  58.  
  59. #
  60.  
  61. #
  62.  
  63. #----------------------------------------------------------
  64.  
  65. #
  66.  
  67. # initialize modem
  68.  
  69. #
  70.  
  71. output "atz"\13
  72.  
  73. if ! [input 10 OK\n]
  74.  
  75.   display "Modem is not responding"\n
  76.  
  77.   abort
  78.  
  79. end
  80.  
  81. #
  82.  
  83. # setup our modem commands
  84.  
  85. #
  86.  
  87. output "at"$modemsetup\13
  88.  
  89. input 10 OK\n
  90.  
  91. #
  92.  
  93. # send phone number
  94.  
  95. #
  96.  
  97. %n = 0
  98.  
  99. repeat
  100.  
  101.   if %n = %attempts
  102.  
  103.     display "Too many dial attempts"\n
  104.  
  105.     abort
  106.  
  107.   end
  108.  
  109.   output "atdt"$number\13
  110.  
  111.   %ok = [input 60 CONNECT]
  112.  
  113.   %n = %n + 1
  114.  
  115. until %ok
  116.  
  117. input 10 \n
  118.  
  119. #
  120.  
  121. #  wait till it's safe to send because some modem's hang up
  122.  
  123. #  if you transmit during the connection phase
  124.  
  125. #
  126.  
  127. wait 30 dcd
  128.  
  129. #
  130.  
  131. # now prod the terminal server
  132.  
  133. #
  134.  
  135. #
  136.  
  137. #  wait for the username prompt
  138.  
  139. #
  140.  
  141. input 30 $userprompt
  142.  
  143. output $username\13
  144.  
  145. #
  146.  
  147. # and the password
  148.  
  149. #
  150.  
  151. input 30 $passprompt
  152.  
  153. output $password\13
  154.  
  155. #
  156.  
  157. # we are now logged in
  158.  
  159. #
  160.  
  161. input 30 $prompt
  162.  
  163. if %ppp
  164.  
  165.   #
  166.  
  167.   # jump into ppp mode
  168.  
  169.   #
  170.  
  171.   output $pppcmd\13
  172.  
  173.   #input 30 \n
  174.  
  175.   #
  176.  
  177.   display "PPP mode selected.  Will try to negotiate IP address."\n
  178.  
  179. else
  180.  
  181.   #
  182.  
  183.   # jump into slip mode
  184.  
  185.   #
  186.  
  187.   output $slipcmd\13
  188.  
  189.   # wait for the address string
  190.  
  191.   #
  192.  
  193.   input 30 $addrtarg
  194.  
  195.   #
  196.  
  197.   # parse address
  198.  
  199.   #
  200.  
  201.   address 30
  202.  
  203.   input 30 \n
  204.  
  205.   #
  206.  
  207.   # we are now connected, logged in and in slip mode.
  208.  
  209.   #
  210.  
  211.   display \n
  212.  
  213.   display Connected.  Your IP address is \i.\n
  214.  
  215. end
  216.  
  217. #
  218.  
  219. # now we are finished.
  220.  
  221. #
  222.  
  223.